Repository navigation
fix(desktop): switch a dead ssh -L forward to an SSH route on its own - #4204
Merged
Merged
Conversation
After a wake a user-run ssh -L keeps its port open on a dead link, and the machine stayed away until the user pressed 'Let RustCode manage this tunnel'. The supervisor now does that takeover itself the first time it finds the tunnel dead and the ssh -L behind it, then retries at once, so later wakes reconnect through a fresh ssh -W within seconds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to #4163. With your own
ssh -L(LagosVPS on127.0.0.1:17880), the tunnel's link dies while the Mac sleeps. Until now the app only offered Let RustCode manage this tunnel. Nobody pressed it, so after every wake LagosVPS stayed offline for about a minute.Now the machine supervisor (
superviseinapps/desktop/src-tauri/src/machines.rs) does the takeover itself. The first time an attempt fails as unreachable, it checks the forward withstalled_forward. If that finds the runningssh -L(its owner) and no SSH route of RustCode's own is on, the supervisor:take_over_forward.It tries this once per supervisor. If the host does not answer, the row keeps its advice and button, as before.
UX
Open the lid after a sleep. The first time, LagosVPS shows Connecting for a few seconds, then reconnects through an SSH route RustCode manages. After later wakes it reconnects within about 15 s, because every connection opens a fresh
ssh -W. You don't need to press anything. Settings › Machines shows the SSH route as on and the forwarded port as off. Turning the forwarded port back on undoes it.Changelog
A machine reached through your own
ssh -Lnow switches to an SSH tunnel RustCode manages the first time that tunnel dies after a sleep, so it reconnects within seconds after later wakes.Testing
cargo fmt --check. No local compile: this was written on the VPS, so CI builds and runs the checks.